{% load widget_tweaks %}

{% csrf_token %}
<p id="password1Help" class="form-text">Passwords must be At least 6 characters. And be secure, please.</p>
{% with WIDGET_ERROR_CLASS='field_error' %}

<input type="password" name="password1" placeholder="New Password" aria-required="true" class="form-control"
  pattern=".{6,}" aria-label="New Password" required="required" id="id_password1" autocomplete="new-password"
  {% if form.password1.errors %}aria-describedby="password1Help" aria-invalid="true" {% endif %}>
</br />
<input type="password" name="password2" placeholder="New Password (again)" aria-required="true" class="form-control"
  pattern=".{6,}" aria-label="New Password (again)" required="required" id="id_password2" autocomplete="new-password"
  {% if form.password2.errors %}aria-describedby="password2Help" aria-invalid="true" {% endif %}>
{% if form.password2.errors %}
<small id="password2Help" class="text-danger">
  {% for error in form.password2.errors %}
  {{ error|escape }}
  {% endfor %}
</small>
{% endif %}
{% endwith %}
